home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-07-28 | 19.0 KB | 1,996 lines |
- # 1 "PPCTimer.c"
- # 1 "include:exec/types.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- typedef void *APTR;
-
- typedef long LONG;
- typedef unsigned long ULONG;
- typedef unsigned long LONGBITS;
- typedef short WORD;
- typedef unsigned short UWORD;
- typedef unsigned short WORDBITS;
-
- typedef signed char BYTE;
-
-
-
- typedef unsigned char UBYTE;
- typedef unsigned char BYTEBITS;
- typedef unsigned short RPTR;
-
-
-
-
- typedef unsigned char *STRPTR;
-
-
-
-
- typedef short SHORT;
- typedef unsigned short USHORT;
- typedef short COUNT;
- typedef unsigned short UCOUNT;
- typedef ULONG CPTR;
-
-
-
- typedef float FLOAT;
- typedef double DOUBLE;
- typedef short BOOL;
- typedef unsigned char TEXT;
-
-
-
-
-
-
-
-
- # 1 "include:sys/commnull.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
- # 79 "include:exec/types.h" 2
-
-
-
-
-
-
-
-
-
-
-
-
- # 1 "PPCTimer.c" 2
-
- # 1 "include:exec/nodes.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct Node {
- struct Node *ln_Succ;
- struct Node *ln_Pred;
- UBYTE ln_Type;
- BYTE ln_Pri;
- char *ln_Name;
- };
-
-
- struct MinNode {
- struct MinNode *mln_Succ;
- struct MinNode *mln_Pred;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # 2 "PPCTimer.c" 2
-
- # 1 "include:exec/lists.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct List {
- struct Node *lh_Head;
- struct Node *lh_Tail;
- struct Node *lh_TailPred;
- UBYTE lh_Type;
- UBYTE l_pad;
- };
-
-
-
-
- struct MinList {
- struct MinNode *mlh_Head;
- struct MinNode *mlh_Tail;
- struct MinNode *mlh_TailPred;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # 3 "PPCTimer.c" 2
-
- # 1 "include:exec/memory.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct MemChunk {
- struct MemChunk *mc_Next;
- ULONG mc_Bytes;
- };
-
-
-
-
- struct MemHeader {
- struct Node mh_Node;
- UWORD mh_Attributes;
- struct MemChunk *mh_First;
- APTR mh_Lower;
- APTR mh_Upper;
- ULONG mh_Free;
- };
-
-
-
-
- struct MemEntry {
- union {
- ULONG meu_Reqs;
- APTR meu_Addr;
- } me_Un;
- ULONG me_Length;
- };
-
-
-
-
-
-
-
-
-
- struct MemList {
- struct Node ml_Node;
- UWORD ml_NumEntries;
- struct MemEntry ml_ME[1];
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct MemHandlerData
- {
- ULONG memh_RequestSize;
- ULONG memh_RequestFlags;
- ULONG memh_Flags;
- };
-
-
-
-
-
-
-
-
-
- # 4 "PPCTimer.c" 2
-
- # 1 "include:utility/tagitem.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- typedef ULONG Tag;
-
- struct TagItem
- {
- Tag ti_Tag;
- ULONG ti_Data;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # 5 "PPCTimer.c" 2
-
- # 1 "../../include/powerup/ppclib/interface.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct Caos
- {
- union
- {
- int Offset;
- APTR Function;
- } caos_Un;
- ULONG M68kCacheMode;
- APTR M68kStart;
- ULONG M68kLength;
- ULONG PPCCacheMode;
- APTR PPCStart;
- ULONG PPCLength;
- ULONG d0;
- ULONG d1;
- ULONG d2;
- ULONG d3;
- ULONG d4;
- ULONG d5;
- ULONG d6;
- ULONG d7;
- ULONG a0;
- ULONG a1;
- ULONG a2;
- ULONG a3;
- ULONG a4;
- ULONG a5;
-
-
-
-
- ULONG a6;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct ModuleArgs
- {
- ULONG M68kCacheMode;
- APTR M68kStart;
- ULONG M68kLength;
- ULONG PPCCacheMode;
- APTR PPCStart;
- ULONG PPCLength;
-
- ULONG Arg1;
- ULONG Arg2;
- ULONG Arg3;
- ULONG Arg4;
- ULONG Arg5;
- ULONG Arg6;
- ULONG Arg7;
- ULONG Arg8;
- DOUBLE FArg1;
- DOUBLE FArg2;
- DOUBLE FArg3;
- DOUBLE FArg4;
- DOUBLE FArg5;
- DOUBLE FArg6;
- DOUBLE FArg7;
- DOUBLE FArg8;
- };
-
-
- # 6 "PPCTimer.c" 2
-
- # 1 "../../include/powerup/ppclib/time.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # 7 "PPCTimer.c" 2
-
- # 1 "../../include/powerup/gcclib/powerup_protos.h" 1
-
-
-
- # 1 "include:dos/dos.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct DateStamp {
- LONG ds_Days;
- LONG ds_Minute;
- LONG ds_Tick;
- };
-
-
-
-
- struct FileInfoBlock {
- LONG fib_DiskKey;
- LONG fib_DirEntryType;
-
- char fib_FileName[108];
- LONG fib_Protection;
- LONG fib_EntryType;
- LONG fib_Size;
- LONG fib_NumBlocks;
- struct DateStamp fib_Date;
- char fib_Comment[80];
-
-
-
-
-
- UWORD fib_OwnerUID;
- UWORD fib_OwnerGID;
-
- char fib_Reserved[32];
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- typedef long BPTR;
- typedef long BSTR;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct InfoData {
- LONG id_NumSoftErrors;
- LONG id_UnitNumber;
- LONG id_DiskState;
- LONG id_NumBlocks;
- LONG id_NumBlocksUsed;
- LONG id_BytesPerBlock;
- LONG id_DiskType;
- BPTR id_VolumeNode;
- LONG id_InUse;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # 4 "../../include/powerup/gcclib/powerup_protos.h" 2
-
-
- # 1 "../../include/powerup/ppclib/object.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct ElfStreamMsg
- {
- ULONG Type;
- ULONG Arg1;
- ULONG Arg2;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct PPCObjectInfo
- {
- ULONG Address;
-
-
-
-
- char *Name;
-
-
- ULONG Type;
-
-
-
-
-
-
-
-
-
-
-
- ULONG SubType;
-
-
-
-
-
- ULONG Binding;
-
-
- ULONG Size;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # 6 "../../include/powerup/gcclib/powerup_protos.h" 2
-
-
-
-
- # 1 "include:intuition/classes.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
- # 1 "include:utility/hooks.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct Hook
- {
- struct MinNode h_MinNode;
- ULONG (*h_Entry)(void);
- ULONG (*h_SubEntry)(void);
- APTR h_Data;
- };
-
-
-
-
- typedef unsigned long (*HOOKFUNC)(void);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # 14 "include:intuition/classes.h" 2
-
-
-
-
- # 1 "include:intuition/classusr.h" 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- typedef ULONG Object;
-
- typedef UBYTE *ClassID;
-
-
-
-
-
-
-
- typedef struct {
- ULONG MethodID;
-
- } *Msg;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct opSet {
- ULONG MethodID;
- struct TagItem *ops_AttrList;
- struct GadgetInfo *ops_GInfo;
-
-
-
- };
-
-
- struct opUpdate {
- ULONG MethodID;
- struct TagItem *opu_AttrList;
- struct GadgetInfo *opu_GInfo;
-
-
-
- ULONG opu_Flags;
- };
-
-
-
-
-
-
-
-
-
-
-
- struct opGet {
- ULONG MethodID;
- ULONG opg_AttrID;
- ULONG *opg_Storage;
-
-
- };
-
-
- struct opAddTail {
- ULONG MethodID;
- struct List *opat_List;
- };
-
-
-
- struct opMember {
- ULONG MethodID;
- Object *opam_Object;
- };
-
-
-
- # 18 "include:intuition/classes.h" 2
-
-
-
-
-
-
-
-
- typedef struct IClass {
- struct Hook cl_Dispatcher;
- ULONG cl_Reserved;
- struct IClass *cl_Super;
- ClassID cl_ID;
-
-
- UWORD cl_InstOffset;
- UWORD cl_InstSize;
-
- ULONG cl_UserData;
- ULONG cl_SubclassCount;
-
- ULONG cl_ObjectCount;
-
- ULONG cl_Flags;
-
- } Class;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- struct _Object {
- struct MinNode o_Node;
- struct IClass *o_Class;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # 10 "../../include/powerup/gcclib/powerup_protos.h" 2
-
-
-
-
-
-
- # 1 "include:stdarg.h" 1
-
-
-
- # 72 "include:stdarg.h"
-
- # 16 "../../include/powerup/gcclib/powerup_protos.h" 2
-
-
- APTR PPCAllocMem( unsigned long byteSize, unsigned long requirements );
- void PPCFreeMem( APTR memoryBlock, unsigned long byteSize );
- APTR PPCAllocVec( unsigned long byteSize, unsigned long requirements );
- void PPCFreeVec( APTR memoryBlock);
- BPTR PPCOutput(void);
- BPTR PPCInput(void);
- BPTR PPCOpen( STRPTR name, long accessMode );
- LONG PPCClose( BPTR file );
- LONG PPCRead( BPTR file, APTR buffer, long length );
- LONG PPCWrite( BPTR file, APTR buffer, long length );
- LONG PPCSeek( BPTR file, long position, long offset );
- APTR PPCCreatePool( unsigned long requirements, unsigned long puddleSize,
- unsigned long threshSize );
- BOOL PPCDeletePool( APTR poolHeader );
- APTR PPCAllocPooled( APTR poolHeader, unsigned long memSize );
- void PPCFreePooled( APTR poolHeader, APTR memory, unsigned long memSize );
- APTR PPCAllocVecPooled( APTR poolHeader, unsigned long memSize );
- void PPCFreeVecPooled( APTR poolHeader, APTR memory);
- ULONG PPCCallOS(struct Caos*);
- ULONG PPCCallM68k(struct Caos*);
- ULONG PPCSignal(void*,ULONG);
- ULONG PPCWait(ULONG);
- void *PPCFindTask(char*);
- ULONG PPCAllocSignal(ULONG);
- void PPCFreeSignal(ULONG);
- void PPCCacheFlush(APTR,ULONG);
- void PPCCacheFlushAll(void);
- void PPCCacheInvalid(APTR,ULONG);
- ULONG PPCSetSignal(ULONG,ULONG);
- void *PPCCreatePort(struct TagItem*);
- BOOL PPCDeletePort(void*);
- void *PPCObtainPort(struct TagItem*);
- BOOL PPCReleasePort(void*);
- void *PPCCreateMessage(void*,
- ULONG);
- void PPCDeleteMessage(void*);
- void *PPCGetMessage(void*);
- ULONG PPCGetMessageAttr(void*,
- ULONG);
- BOOL PPCReplyMessage(void*);
- BOOL PPCSendMessage(void*,
- void*,
- void*,
- ULONG,
- ULONG);
- void *PPCWaitPort(void*);
-
- void* PPCCreatePortList(void**,ULONG);
- void PPCDeletePortList(void*);
- BOOL PPCAddPortList(void*,
- void*);
- void PPCRemPortList(void*,
- void*);
- void* PPCWaitPortList(void*);
- ULONG PPCGetPortListAttr(void*,
- ULONG);
- void PPCSetPortListAttr(void*,
- ULONG,
- ULONG);
-
-
- int strcmp(const char *,
- const char *);
- char *strcpy(char *,
- const char *);
- int strlen(const char *);
-
-
-
-
-
-
-
-
- void PPCInsert(struct List *,
- struct Node *,
- struct Node *);
- void PPCAddHead(struct List *,
- struct Node *);
- void PPCAddTail(struct List *,
- struct Node *);
- void PPCRemove(struct Node *);
- struct Node* PPCRemHead(struct List *);
- struct Node* PPCRemTail(struct List *);
- void PPCEnqueue(struct List*,
- struct Node*);
- struct Node* PPCFindName(struct List*,
- char*);
- void PPCNewList(struct List *);
-
-
- void PPCInsertSync(struct List *,
- struct Node *,
- struct Node *);
- void PPCAddHeadSync(struct List *,
- struct Node *);
- void PPCAddTailSync(struct List *,
- struct Node *);
- void PPCRemoveSync(struct Node *);
- struct Node* PPCRemHeadSync(struct List *);
- struct Node* PPCRemTailSync(struct List *);
- void PPCEnqueueSync(struct List*,
- struct Node*);
- struct Node* PPCFindNameSync(struct List*,
- char*);
-
- struct TagItem* PPCNextTagItem(struct TagItem**);
- struct TagItem* PPCFindTagItem(Tag,
- struct TagItem*);
- ULONG PPCGetTagData(Tag,
- ULONG,
- struct TagItem *);
-
- ULONG PPCVersion(void);
- ULONG PPCRevision(void);
-
- void PPCReleaseSemaphore(void*);
- void PPCObtainSemaphore(void*);
- LONG PPCAttemptSemaphore(void*);
- BOOL PPCAttemptSemaphoreShared(void*);
- void PPCObtainSemaphoreShared(void*);
- void* PPCCreateSemaphore(struct TagItem*);
- void PPCDeleteSemaphore(void*);
- void* PPCObtainSemaphoreByName(char*);
- void* PPCAttemptSemaphoreByName(char*,
- ULONG*);
-
- APTR PPCRawDoFmt(UBYTE*,
- APTR,
- void (*)(),
- APTR);
-
- ULONG PPCGetTaskAttr(ULONG);
- void PPCSetTaskAttr(ULONG,
- ULONG);
-
- void PPCFinishTask(void);
-
- ULONG PPCGetAttr(ULONG);
-
- UBYTE PPCReadByte(UBYTE*);
- UWORD PPCReadWord(UWORD*);
- ULONG PPCReadLong(ULONG*);
-
- void PPCWriteByte(UBYTE*,UBYTE);
- void PPCWriteWord(UWORD*,UWORD);
- void PPCWriteLong(ULONG*,ULONG);
-
- ULONG PPCCoerceMethodA(struct IClass*,
- Object*,
- Msg);
-
- ULONG PPCDoMethodA(Object*,
- Msg);
-
- ULONG PPCDoSuperMethodA(struct IClass*,
- Object*,
- void*);
-
- void PPCkprintf(const char*,
- ...);
-
- int PPCprintf(const char*,
- ...);
-
- int PPCsprintf(char*,
- const char*,
- ...);
-
- void PPCvkprintf(const char*,
- va_list);
-
- int PPCvprintf(const char*,
- va_list);
-
- int PPCvsprintf(char*,
- const char*,
- va_list);
-
- int PPCfprintf(BPTR,
- const char *FmtString,
- ...);
-
- int PPCvfprintf(BPTR,
- const char*,
- va_list);
-
- void *PPCCreateTask(void*,
- void*,
- struct TagItem*);
-
- void *PPCOpenLibrary(void*,
- struct TagItem*);
-
- void PPCCloseLibrary(void*);
- void *PPCGetLibSymbol(void*,
- char*);
-
-
- void *PPCLoadObjectTagList(struct TagItem*);
- void *PPCLoadObject(char*);
- void PPCUnLoadObject(void*);
- ULONG PPCGetObjectAttrs(void*,
- struct PPCObjectInfo*,
- struct TagItem*);
-
- void* PPCCreateTimerObject(struct TagItem*);
- void PPCDeleteTimerObject(void*);
-
-
- void PPCSetTimerObject(void*,
- ULONG,
- unsigned long long*);
-
- void PPCGetTimerObject(void*,
- ULONG,
- unsigned long long*);
- # 243 "../../include/powerup/gcclib/powerup_protos.h"
-
-
-
-
-
-
-
-
-
- int __cmpdi2(long long, long long);
- long long __adddi3(long long, long long);
- long long __anddi3(long long, long long);
- long long __ashldi3(long long, unsigned int);
- long long __ashrdi3(long long, unsigned int);
- long long __lshldi3(long long, unsigned int);
- long long __lshrdi3(long long, unsigned int);
- int __cmpdi2(long long, long long );
- long long __divdi3(long long, long long);
- long long __fixdfdi(double);
- long long __fixsfdi(float);
- unsigned long long __fixunsdfdi(double);
- unsigned long long __fixunssfdi(float);
- double __floatdidf(long long);
- float __floatdisf(long long);
- double __floatunsdidf(unsigned long long);
- long long __iordi3(long long, long long);
- long long __moddi3(long long, long long);
- long long __muldi3(long long, long long);
- long long __negdi2(long long);
-
- unsigned long long __qdivrem(unsigned long long, unsigned long long, unsigned long long *);
- long long __subdi3(long long, long long);
- int __ucmpdi2(unsigned long long, unsigned long long);
- unsigned long long __udivdi3(unsigned long long, unsigned long long );
- unsigned long long __umoddi3(unsigned long long, unsigned long long );
- long long __xordi3(long long, long long);
-
- long long PPCAdd64(long long,long long);
- long long PPCSub64(long long,long long);
- long long PPCNeg64(long long);
- BOOL PPCCmp64(long long,long long);
- long long PPCMulu64(long long,long long);
- long long PPCDivu64(long long,long long);
- long long PPCMuls64(long long,long long);
- long long PPCDivs64(long long,long long);
- long long PPCModu64(long long,long long);
- long long PPCMods64(long long,long long);
- long long PPCLsr64(unsigned long long,unsigned int);
- long long PPCAsl64(long long,unsigned int);
- long long PPCAsr64(long long,unsigned int);
- long long PPCLsr64(unsigned long long,unsigned int);
- long long PPCOr64(unsigned long long,unsigned long long);
- long long PPCXor64(unsigned long long,unsigned long long);
- long long PPCAnd64(unsigned long long,unsigned long long);
- long long PPCDivRem64(long long,long long,long long*);
-
- # 324 "../../include/powerup/gcclib/powerup_protos.h"
-
-
-
- # 8 "PPCTimer.c" 2
-
-
- int main(void)
- {
- long long Result;
- long long Ticks;
- long long TicksPerSec;
- void *MyTimerObject;
- void *MyTimerJob;
- ULONG b;
- int i;
- struct TagItem MyTags[4];
- ULONG MySignal;
-
- MyTags[0].ti_Tag = ((((ULONG)(1L<<31)) + 0x24000) + 0x1) ;
- MyTags[0].ti_Data = 1 ;
- MyTags[1].ti_Tag = (0L) ;
- if (MyTimerObject=PPCCreateTimerObject(MyTags))
- {
- PPCSetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x11) ,
- 0L );
-
-
-
-
- PPCOutput();
-
- PPCSetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x12) ,
- 0L );
-
-
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x13) ,
- &TicksPerSec);
-
- PPCprintf("TicksPerSec %Ld\n",TicksPerSec);
-
-
-
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x11) ,
- &Result);
-
- PPCprintf("StartTicks 0x%Lx\n",Result);
-
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x12) ,
- &Result);
-
- PPCprintf("StopTicks 0x%Lx\n",Result);
-
-
-
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x14) ,
- &Result);
- PPCprintf("Current 0x%Lx\n",Result);
-
-
-
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x15) ,
- &Result);
- PPCprintf("DiffTicks %Ld\n",Result);
-
-
- PPCprintf("PPCOutput() context switch took %4g seconds\n",
- (((double) (Result) / (double)TicksPerSec)));
- __asm("twi 31,0,0\n");
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x16) ,
- &Result);
- PPCprintf("DiffMicro %Ld\n",Result);
-
-
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x17) ,
- &Result);
- PPCprintf("DiffSecs %Ld\n",Result);
-
-
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x18) ,
- &Result);
- PPCprintf("DiffMins %Ld\n",Result);
-
-
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x19) ,
- &Result);
- PPCprintf("DiffHours %Ld\n",Result);
-
-
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x1a) ,
- &Result);
- PPCprintf("DiffDays %Ld\n",Result);
-
-
- PPCprintf("Use 50Hz Timer to wait 4 seconds\n");
-
- if ((MySignal==PPCAllocSignal(-1)) != -1)
- {
- MyTags[0].ti_Tag = ((((ULONG)(1L<<31)) + 0x24000) + 0x2) ;
- MyTags[0].ti_Data = 50*4;
- MyTags[1].ti_Tag = ((((ULONG)(1L<<31)) + 0x24000) + 0x3) ;
- MyTags[1].ti_Data = 1<<MySignal;
-
-
-
- MyTags[2].ti_Tag = ((((ULONG)(1L<<31)) + 0x24000) + 0x4) ;
- MyTags[2].ti_Data = 1 ;
- MyTags[3].ti_Tag = (0L) ;
-
- PPCSetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x11) ,
- 0L );
-
- if (MyTimerJob=PPCCreateTimerObject(MyTags))
- {
- PPCWait(1<<MySignal);
- PPCSetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x12) ,
- 0L );
-
- PPCprintf("notification received\n");
- PPCDeleteTimerObject(MyTimerJob);
-
- PPCGetTimerObject(MyTimerObject,
- ((((ULONG)(1L<<31)) + 0x24000) + 0x15) ,
- &Ticks);
-
- PPCprintf("DiffTicks %Ld\n",Ticks);
-
- PPCprintf("waited for %g seconds\n",
- ((double) Ticks) / TicksPerSec);
-
-
- }
- PPCFreeSignal(MySignal);
- }
- else
- {
- PPCprintf("Couldn`t alloc Signal\n");
- }
-
- PPCDeleteTimerObject(MyTimerObject);
- }
- }
-
-